﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MobiMenu.Restaurant.Web.Utility
{
    public class IgnoreCaseEqualityComparer : IEqualityComparer<string>
    {
        #region IEqualityComparer<string> 成员

        public bool Equals(string x, string y)
        {
            return string.Equals(x, y, StringComparison.InvariantCultureIgnoreCase);
        }

        public int GetHashCode(string obj)
        {
            return obj == null ? 0 : obj.GetHashCode();
        }

        #endregion

        private static IgnoreCaseEqualityComparer _default = new IgnoreCaseEqualityComparer();
        public static IgnoreCaseEqualityComparer Default
        {
            get
            {
                return _default;
            }
        }
    }
}
